package com.library.admin.manager;

import com.library.admin.list.BookTable;
import com.library.admin.listener.ShowAddBookFormListener;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.VerticalLayout;

public class BookManagerPanel extends VerticalLayout {
	private static final long serialVersionUID = 1157014738045396508L;
	
	private HorizontalLayout buttonPanel;
	private Button addBookButton;
	private BookTable bookTable;

	public BookManagerPanel() {
		init();
	}

	public void init() {
		setWidth("100%");
		
		buttonPanel = new HorizontalLayout();
		addBookButton = new Button("Ajouter un livre");
		bookTable = new BookTable();
		
		addBookButton.addListener(new ShowAddBookFormListener());
		
		buttonPanel.addComponent(addBookButton);
		
		addComponent(buttonPanel);
		addComponent(bookTable);
	}

	public BookTable getBookTable() {
		return bookTable;
	}
}
